<?php
 
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class StatusController extends BaseController
{
    /**
     * Create a new controller instance.
     */
    public function __construct()
    {

    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return view('home');
    }

    public function setBrowseLog(Request $request) 
    {
    	$action = \Route::current()->getActionName();
        list($class, $method) = explode('@', $action);
        $class = substr(strrchr($class,'\\'),1);
 		print_r($request->all());
 		print_r($uri = $request->path());
 		$url = $request->url();
var_dump($url);

		// With Query String...
		$url = $request->fullUrl();
var_dump($url);
        $tableName = 'status_original_data';
        $tables = config('tables');
        if (isset($tables['status'][$tableName])) {
            $tableName = $tables['prefix'] . $tables['status'][$tableName];
        }
        $input = [
        	'module' => $class,
        	'action' => $method,
        	'ip_address' => $request->ip(),
        	'updated_at' => date('Y-m-d H:i:s'),
        ];
        $users = DB::table($tableName)->insert($input);
        // var_dump($users);

    }
}
